/*
  This file is part of 'Trivial chess'.

  'Trivial chess' is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  'Trivial chess' is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with 'Trivial chess'.  If not, see <http://www.gnu.org/licenses/>.
*/

/* SVN FILE: $Id$ */
/**
 * @author         $Author$
 * @version        $Rev$
 * @lastrevision   $Date$
 * @filesource     $URL$
 */

#ifndef MANORD_H_
#define MANORD_H_

#include <boost/cstdint.hpp>

#include "ManAbstract.h"
#include "../OrdAbstract.h"

template<class C, class P, typename Int = int8_t>
class ManOrd
	: public ManAbstract<ManOrd,C,P,Int >,
	  public OrdAbstract<ManOrd<C,P,Int>,C,P,Int,1> {
public:
		ManOrd<C,P,Int>()
		: OrdAbstract<ManOrd, Color, Piece, Int, 1>() {}

	explicit ManOrd<C,P,Int>(const Int man)
		: OrdAbstract<ManOrd, Color, Piece, Int, 1>(man) {}

	explicit ManOrd<C,P,Int>(const std::string str)  {
		this->me().fromStr(str);
	}

	ManOrd<C,P,Int>(const Color color, const Piece piece)
		: OrdAbstract<ManOrd,C,P,Int,1>(color, piece) {}

	const Color color() const { return this->me_c().fst(); }
	const Piece piece() const { return this->me_c().scd(); }

	void setColor(const Color color) { this->me().setFst(color); }
	void setPiece(const Piece piece) { this->me().setScd(piece); }
};

#endif /* MANORD_H_ */
